from PySide6.QtWidgets import QApplication, QWidget
from ui.login import Ui_Form
import sys

# 1. 此处利用python的多继承，继承了生成的ui
class MyWidget(QWidget, Ui_Form):
    def __init__(self) -> None:
        super().__init__()
        # 2. 此处调用 Ui_Form  类中的初始化ui方法
        self.setupUi(self)
        
        self.pushButton.clicked.connect(self.loginFunc)
        
    def loginFunc(self):
        account = self.lineEdit.text()
        password = self.lineEdit_2.text()
        print(f'登录账号：{account}, 密码：{password}')

if __name__ == '__main__':
    app = QApplication(sys.argv)
    window = MyWidget()
    window.show()
    app.exec()